%{
	business.BackstageSet  currBackstageSet = business.BackstageSet.getCurrentBackstageSet();
}%
#{extends 'common/frontMain.html' /} 
#{set title:currBackstageSet.seoTitle +' | 我的账户   | 理财子账户 | 债权转让管理  | '+debtBussiness?.title+'债权标详情  '/}
<div class="xf_lczzh_btg">
			<div class="xf_lczzh_btg_title">会员${debtBussiness?.invest?.user?.name}向您转让${debt?.transer_id}号债权标</div>
			<div class="xf_lczzh_btg_tcon">
				转让方：<span class="xf_lczzh_btg_red">${debtBussiness?.invest?.user?.name}</span> <br />
				转让方式：<span class="xf_lczzh_btg_red">定向转让</span> <br />
				转让标题：<span class="xf_lczzh_btg_red">${debtBussiness?.title}</span><br />
				待收本金转让底价：<span class="xf_lczzh_btg_red">${debt?.transfer_price}</span><br />
				转让截止时间：<span class="xf_lczzh_btg_red">${debtBussiness?.endTime?.format('yyyy-MM-dd')}</span><br />
				转让原因：<span class="xf_lczzh_btg_red">${debtBussiness?.transerReason}</span><br />
			</div>
				<div class="xf_lczzh_btg_zrxq">
				<div class="xf_lczzh_btg_title2">转让的借款标情况</div>
				<div class="xf_lczzh_btg_tcon2">
					<table border="0" cellpadding="0" cellspacing="0" width="684" class="xf_membill_zqzr">
						<tr>
							<td>借款标编号：${debt?.bid_no}</td>
							<td>借款人：${debt?.name}</td>
							<td>借款标类型：${debtBussiness?.invest?.bid?.product?.name}</td>
						</tr>
						<tr>
							<td colspan="3">借款标标题：${debt?.title}</td>
						</tr>
						<tr>
							<td>投标本金：${debtBussiness?.invest?.amount?.format('###,##0.00')} 元</td>
							<td colspan="2">年利率：${debt?.apr} %</td>
						</tr>
						
						
						
						#{if debt?.status != 1}
						<tr>
							<td>本息合计应收金额：
							#{if debt?.receiving_amount != null && debt?.receiving_amount != 0}
							${debt?.receiving_amount?.format('###,##0.00')}
							#{/if} 
							#{else}0#{/else}
							元</td>
							<td colspan="2">已收金额：
							#{if debt?.has_received_amount == null || debt?.has_received_amount ==0}
							0
							#{/if}
							#{else}
							${debt?.has_received_amount?.format('###,##0.00')}
							#{/else}
							 元</td>
						</tr>
						<tr>
							<td>剩余应收款：
							#{if debt?.remain_received_amount != null && debt?.remain_received_amount != 0}
							${debt?.remain_received_amount?.format('###,##0.00')}
							#{/if}
							#{else}
							0
							#{/else}
							 元</td>
							<td>还款日期：${debtBussiness?.invest?.bid?.recentRepayTime?.format('yyyy-MM-dd')}</td>
							<td>待收本金：
							#{if debt?.remain_received_corpus != null && debt?.remain_received_corpus != 0}
							${debt?.remain_received_corpus?.format('###,##0.00')}
							#{/if}
							#{else}0#{/else} 
							元</td>
						</tr>
						#{/if}
						
						#{else}
						<tr>
							<td>本息合计应收金额：
							#{if debt?.receiving_amount_success != null && debt?.receiving_amount_success != 0}
							${debt?.receiving_amount_success?.format('###,##0.00')}
							#{/if} 
							#{else}0#{/else}
							元</td>
							<td colspan="2">已收金额：
							#{if debt?.has_received_amount_success == null || debt?.has_received_amount_success ==0}
							0
							#{/if}
							#{else}
							${debt?.has_received_amount_success?.format('###,##0.00')}
							#{/else}
							 元</td>
						</tr>
						<tr>
							<td>剩余应收款：
							#{if debt?.remain_received_amount_success != null && debt?.remain_received_amount_success != 0}
							${debt?.remain_received_amount_success?.format('###,##0.00')}
							#{/if}
							#{else}
							0
							#{/else}
							 元</td>
							<td>还款日期：${debtBussiness?.invest?.bid?.recentRepayTime?.format('yyyy-MM-dd')}</td>
							<td>待收本金：
							#{if debt?.remain_received_corpus_success != null && debt?.remain_received_corpus_success != 0}
							${debt?.remain_received_corpus_success?.format('###,##0.00')}
							#{/if}
							#{else}0#{/else} 
							元</td>
						</tr>
						
						
						#{/else}
						
						#{form @acceptDebts(), method:'POST', id:'acceptDebts'}
							<input type="hidden" name="uuidRepeat" value="${flash?.success}">
							#{if debtBussiness?.invest?.bid?.product?.isDealPassword == true}
							<tr>
							<td>
								交易密码：<input type="password" name="dealpwd" id="dealpwd" onMouseOver="checkPwdDel();"/>
								 #{if user != null && user.payPassword == null}
								  <a href="@{front.account.BasicInformation.modifyPassword()}" class="xf_ta_onclick">您未设置交易密码！点击此处设置交易密码</a>
								 #{/if}
							</td>
							<tr>
							#{/if}
						<input type="hidden" value="${debt?.sign}" name="sign"/>
					#{/form}
					</table>
				</div>
			</div>
			<div class="xf_lczzh_btg_dqzt">
				#{if debt?.status == 2}
				<a class="xf_con_inputfbjk" onclick="deal();">确认受让</a>
				<a class="xf_con_inputfbjk"  onclick="refuse();">拒绝受让</a>
				#{/if}
			</div>
		</div>
		
		
		
		
		<script>
		function checkPwdDel(){
			var str = "请输入交易密码";
			#{if debtBussiness?.invest?.bid?.product?.isDealPassword == true}	
			
				#{if user != null && user.payPassword == null}
				 str = "您还未设置交易密码,请设置交易密码";
	        	#{/if}
			#{/if}

			$("#dealpwd").attr("title",str);
		}
			
		function deal(){
			if (confirm("确认受让？")) {
	            $("#acceptDebts").submit();
	        }
		}
					
		function refuse(){
					if (!confirm("确认拒绝受让？")) {
			            return;
			        }
					var debtId = "${debt?.sign}";
					var notAccept = #{jsAction @notAccept(':debtId')/}
			    	$.post(notAccept({debtId:debtId}),function(data){
			    		var arr=eval(data);
						var result = arr.error.msg;
						alert(result);
						 window.location.href="@{myDebts()}";
   	                 })
   	                 
   	                 
				}
</script>